1
|
|
|
/* |
2
|
|
|
* Copyright 2011 Johannes M. Schmitt <[email protected]> |
3
|
|
|
* |
4
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License"); |
5
|
|
|
* you may not use this file except in compliance with the License. |
6
|
|
|
* You may obtain a copy of the License at |
7
|
|
|
* |
8
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0 |
9
|
|
|
* |
10
|
|
|
* Unless required by applicable law or agreed to in writing, software |
11
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS, |
12
|
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
13
|
|
|
* See the License for the specific language governing permissions and |
14
|
|
|
* limitations under the License. |
15
|
|
|
*/ |
16
|
|
|
|
17
|
|
|
goog.provide('twig.ExtensionInterface'); |
|
|
|
|
18
|
|
|
|
19
|
|
|
/** |
20
|
|
|
* Interface implemented by extension classes. |
21
|
|
|
* |
22
|
|
|
* @interface |
23
|
|
|
*/ |
24
|
|
|
twig.ExtensionInterface = function() {}; |
|
|
|
|
25
|
|
|
|
26
|
|
|
/** |
27
|
|
|
* Initializes the runtime environment. |
28
|
|
|
* |
29
|
|
|
* This is where you can load some file that contains filter functions for instance. |
30
|
|
|
* |
31
|
|
|
* @param {twig.Environment} environment The current environment instance |
32
|
|
|
*/ |
33
|
|
|
twig.ExtensionInterface.prototype.initRuntime = function(environment) {}; |
|
|
|
|
34
|
|
|
|
35
|
|
|
/** |
36
|
|
|
* Returns a list of filters to add to the existing list. |
37
|
|
|
* |
38
|
|
|
* @return {Object} An array of filters |
39
|
|
|
*/ |
40
|
|
|
twig.ExtensionInterface.prototype.getFilters = function() {}; |
|
|
|
|
41
|
|
|
|
42
|
|
|
/** |
43
|
|
|
* Returns a list of tests to add to the existing list. |
44
|
|
|
* |
45
|
|
|
* @return {Object} An array of tests |
46
|
|
|
*/ |
47
|
|
|
twig.ExtensionInterface.prototype.getTests = function() {}; |
|
|
|
|
48
|
|
|
|
49
|
|
|
/** |
50
|
|
|
* Returns a list of functions to add to the existing list. |
51
|
|
|
* |
52
|
|
|
* @return {Object} An array of functions |
53
|
|
|
*/ |
54
|
|
|
twig.ExtensionInterface.prototype.getFunctions = function() {}; |
|
|
|
|
55
|
|
|
|
56
|
|
|
/** |
57
|
|
|
* Returns a list of global variables to add to the existing list. |
58
|
|
|
* |
59
|
|
|
* @return {Object} An array of global variables |
60
|
|
|
*/ |
61
|
|
|
twig.ExtensionInterface.prototype.getGlobals = function() {}; |
|
|
|
|
62
|
|
|
|
63
|
|
|
/** |
64
|
|
|
* Returns the name of the extension. |
65
|
|
|
* |
66
|
|
|
* @return {string} The extension name |
67
|
|
|
*/ |
68
|
|
|
twig.ExtensionInterface.prototype.getName = function() {}; |
|
|
|
|
69
|
|
|
|
This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.
To learn more about declaring variables in Javascript, see the MDN.